package com.naiterui.ehp.bs.patient.bo.notice;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.naiterui.ehp.bs.patient.config.TemplateProperties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
 * <pre>
 * 医生拒绝求药申请结果通知
 * </pre>
 *
 * @author fangguanhong
 * @date 2020/5/13 下午3:49
 * @since 1.0.0
 */
@Data
@Builder
@AllArgsConstructor
public class RequireReplyMsg extends BaseNotice {
    private static final long serialVersionUID = 1144579368184027729L;

    /**
     * 医生姓名
     */
    private String doctorName;
    /**
     * 处理状态
     */
    private String processStaus;
    /**
     * 处理时间
     */
    private String processTime;
    /**
     * 备注原因
     */
    private String processRemark;

    @Override
    public String getTemplateLabel() {
        return "REQUIRE_REPLY";
    }

    @Override
    public void handleContent(List<TemplateProperties.Content> contentList) {
        Map<String, String> formatMap = new HashMap<>();
        formatMap.put("DOCTOR_NAME", this.doctorName);
        formatMap.put("PROCESS_STATUS", this.processStaus);
        formatMap.put("PROCESS_TIME", this.processTime);
        formatMap.put("PROCESS_REMARK", this.processRemark);
        super.formatData(contentList, formatMap);
    }

    @Override
    public boolean validate() {
        return super.validate() && StringUtils.isNoneBlank(doctorName) && StringUtils.isNoneBlank(processStaus)
                && StringUtils.isNoneBlank(processTime) && StringUtils.isNoneBlank(processRemark);
    }

}
